{include file='pub/header'/}
<title>公告列表</title>
</head>
<body class="pos-r">
<div>
    <nav class="breadcrumb">{$breadNav}<a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px"
                                          href="javascript:location.replace(location.href);" title="刷新">
        <i class="Hui-iconfont">&#xe68f;</i>
    </a></nav>
    <div class="page-container">
        <div class="cl pd-5 bg-1 bk-gray mt-20">
            <span class="l">
                <a class="btn btn-primary radius" onclick="report_add('添加轮播图','{:url(\'swiperAdd\')}')" href="javascript:;">
                    <i class="Hui-iconfont">&#xe600;</i> 添加轮播图
                </a>
            </span>
        </div>
        <div class="mt-20">
            <table class="table table-border table-bordered table-bg table-hover table-sort">
                <thead>
                <tr class="text-c">
                    <th width="40">ID</th>
                    <th width="40">预览图</th>
                    <th width="40">序号</th>
                    <th width="100">操作</th>
                </tr>
                </thead>
                <tbody>
                {foreach $list as $item}
                <tr class="text-c va-m">
                    <td>{$item.id}</td>
                    <td>
                        <img src="{$item.image}" style="width: 60px;"/>
                    </td>
                    <td>
                        {$item.ord}
                    </td>
                    <td class="td-manage">
                        <a style="text-decoration:none" class="ml-5"
                           onClick="layer_show('轮播图编辑','{:url(\'Site/swiperEdit\', [\'id\'=>$item.id])}')"
                           href="javascript:;" title="">
                            <i class="Hui-iconfont">&#xe685;</i>
                            编辑
                        </a>
                        <a style="text-decoration:none" class="ml-5" onClick="swiper_del(this,'{$item.id}')"
                           href="javascript:;" title="删除">
                            <i class="Hui-iconfont">&#xe6e2;</i>删除
                        </a>
                    </td>
                </tr>
                {/foreach}
                </tbody>
            </table>
        </div>
    </div>
</div>

{include file='pub/footer'/}
<script type="text/javascript">
    function report_add(title, url) {
        layer_show(title, url);
    }

    function swiper_del(o, id) {
        layer.confirm('确定删除？', function () {
            $.post("{:url('swiperDel')}", {id:id}, function (res) {
                if(res.code == 1){
                    layer.msg('删除成功');
                    $(o).parent().parent().remove();
                }else{
                    layer.msg(res.msg);
                }
            });
        })
    }


</script>
</body>
</html>